//
//  ZArenaController.m
//  Zlottery
//
//  Created by HuaYingJiTuan on 16/1/8.
//  Copyright © 2016年 张庆庆. All rights reserved.
//
#define kCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]

#import "ZArenaController.h"
#import "ZArenaView.h"
#import "UIView+EX.h"
@interface ZArenaController ()

@end

@implementation ZArenaController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"NLArenaNavBar64"] forBarMetrics:UIBarMetricsDefault];
    
    UISegmentedControl *segment = [[UISegmentedControl alloc]initWithItems:@[@"足球",@"篮球"]];
    segment.width = 120;
    //设置segment的背景图片
    [segment setBackgroundImage:[UIImage imageNamed:@"CPArenaSegmentBG"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    [segment setBackgroundImage:[UIImage imageNamed:@"CPArenaSegmentSelectedBG"] forState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
    
    segment.selectedSegmentIndex = 0;
    
    //设置文字的颜色
    [segment setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]} forState:UIControlStateSelected];
    [segment setTitleTextAttributes:@{NSForegroundColorAttributeName:kCOLOR(6, 150, 120)} forState:UIControlStateNormal];
    self.navigationItem.titleView = segment;
    
    self.view = [[ZArenaView alloc]init];
}



@end
